﻿using System.Collections.Generic;
using System.Linq;
using VideoSeller.Business.Data;

namespace VideoSeller.Business.Models
{
	public class CategoryModel : Repository<Category>
	{
		public void Create(Category category)
		{
			Insert(category);
			SubmitAllChanges();
		}

		public Category GetCategory(int id)
		{
			return Table.SingleOrDefault(x => x.Id == id);
		}

		public IEnumerable<Category> GetCategories()
		{
			return Table.AsEnumerable();
		}
	}
}